<!DOCTYPE html>
<html>
	
	<head>
		<meta charset="utf-8">

		<!-- !Always force latest IE rendering engine (even in intranet) & Chrome Frame
		Remove this if you use the .htaccess -->
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

		<title>05_JavaScript_with</title>
		<meta name="description" content="">
		<meta name="author" content="chenyong">

		<meta name="viewport" content="width=device-width; initial-scale=1.0">

		<!-- Replace favicon.ico & apple-touch-icon.png in the root of your domain and delete these references -->
		<link rel="shortcut icon" href="/favicon.ico">
		<link rel="apple-touch-icon" href="/apple-touch-icon.png">
		
		<style type="text/css">
			
			
			body{
				margin:50px;
			}
			
			div{
				font-size:12px;
			}
			
			div.box{
				margin-top:30px;
			}
		
			
		</style>
		
		<script type="text/javascript">
			
			// document.write('<h3>05_JavaScript_with</h3>');
			// document.write('<div class="box" >');
			// document.write('<p><b>with关键字</b></p>');
			// document.write('<p>使用with关键字表示花括弧内所有代码都基于指定对象作为根对象</p>');
			// document.write('</div>');
			
			//等同于上面一段代码 
			with(document){
				write('<h3>05_JavaScript_with</h3>');
				write('<div class="box" >');
				write('<p><b>with关键字</b></p>');
				write('<p>使用with关键字表示花括弧内所有代码都基于指定对象作为根对象</p>');
				write('</div>');
			}
			
			
		</script>
	</head>
	
	<body>
		
		
		
		
		
	
	
	</body>
	
</html>